package com.example.PDFdemo.crossseal;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.itextpdf.text.DocumentException;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

@Slf4j
public class Test {
    public static void main(String[] args) throws DocumentException, IOException {
//        String oldFile = "C:\\Users\\admin\\Desktop\\1.pdf";
//        String newFile = "C:\\Users\\admin\\Desktop\\test4.pdf";
//        String src = "https://testyinji.gaoshan.co/oss/gs2021/20220303/a3dd0c6e00848e7a748bdc83b82528cb1ea6ba54e4e662a6c3022e7caefa68f2.png";
//        PDFUtil util = new PDFUtil();
//        util.crossSeal(oldFile, newFile, src);
//        Long id = 1L;
//        String key = "test" + id;
//        System.out.println(key);
//        int i = 10;
//        System.out.println(i/10);
//        Map<String, String> m = new HashMap<>();
//        m.put("1", "2");
//        m.put("1", "3");
//        System.out.println(new ArrayList<>(m.values()));
//        C c = new C();
//        Long[] ids = new Long[] {null};
//        log.info(c.toString());
//        if (ObjectUtil.isNotEmpty(ids)) {
//            System.out.println("111111111111111111111");
//        } else {
//            System.out.println("222222222222222222222");
//        }
        String str = "请帮我写一份朋友圈分享文章。{1}{2}{3}";
        Map<String,String> params = new HashMap<String, String>();
        params.put("1",":  Test1  :");
        //params.put("2",":  Test2  :");
        params.put("2", "");
        params.put("3",":  Test3  :");
        System.out.println(StrUtil.format(str, params));
    }
}
